import {observable,action} from 'mobx-miniprogram'
//获取用户信息
export const store= observable({
  //数据字段
  activeTabBarIndex: 0,
  userId:wx.getStorageSync('userId') ? wx.getStorageSync('userId') : '',
  userName:wx.getStorageSync('userName') ? wx.getStorageSync('userName') : '',
  token:wx.getStorageSync('token') ? wx.getStorageSync('token') : '',
  //action函数
  updateActiveTabBarIndex: action(function(index){
    this.activeTabBarIndex = index;
  }),
  // updatetoken: action(function(removetoken){
  //   this.token = removetoken;
  // }),
  // updateuserId: action(function(removeuserid){
  //   this.userId = removeuserid;
  // }),
  // updateusername: action(function(removeusername){
  //   this.userName = removeusername;
  // })
})
